package com.basejace.common.utils;

import java.security.MessageDigest;

import sun.misc.BASE64Encoder;

public class MD5 {

	public static String encode(String str) throws Exception {
		MessageDigest md5 = MessageDigest.getInstance("MD5");
		BASE64Encoder base64en = new BASE64Encoder();
		return base64en.encode(md5.digest(str.getBytes("utf-8")));
	}
}
